//
//  SEGActivityDetailViewModel.h
//  Commom
//
//  Created by Clavis on 2020/6/18.
//

#import <Foundation/Foundation.h>
#import <SEGModel/SEGActivityDetailCommentModel.h>
#import <ReactiveObjC/ReactiveObjC.h>

#define kActicityErrorCode_NoAuth 999 // 没有权限的活动error code

@interface SEGActivityDetailViewModel : NSObject

/// 活动ID（必传参数）
@property (nonatomic, copy) NSString *actId;

/// 抽奖实例ID
@property (nonatomic, strong) NSString *lotteryId;

/// 是否是触发抽奖活动
@property (nonatomic, assign) BOOL isTriggerLottery;

/// 签到活动ID（用于触发福利社传参）
@property (nonatomic, copy) NSString *homeSignActId;

/// 是否已经加载过详情信息
@property (nonatomic, assign) __block BOOL isAreadyLoad;

#pragma mark - 活动详情通用逻辑
/// 加载活动详情信号量
@property (nonatomic, strong) RACSignal *requestActicityDeatilSignal;
/// 活动点赞信号量
@property (nonatomic, strong) RACSignal *requestPraiseActivitySignal;
/// 对活动评论信号量
@property (nonatomic, strong) RACCommand *submitCommnetCommand;
/// 提交活动分享记录信号量
@property (nonatomic, strong) RACSignal *submitShareRecordSignal;
/// 对评论点赞的信号量
@property (nonatomic, strong) RACCommand *praiseCommentCommand;
/// 检查活动是否审核
@property (nonatomic, strong) RACSignal *checkActivityExamineSignal;

#pragma mark - 各个类型的活动自己逻辑
/// 请求抽奖活动主体
@property (nonatomic, strong) RACSignal *requestLotteryDetailSignal;
/// 参与抽奖活动
@property (nonatomic, strong) RACSignal *participateLotterySignal;

/// 请求线下类 剩余名额和报名审核状态
@property (nonatomic, strong) RACSignal *requestOfflineStatusSignal;
/// 参加线下活动
@property (nonatomic, strong) RACCommand *joinOfflineActivityCommand;

/// 参加触发活动
@property (nonatomic, strong) RACSignal *joinTriggerActivitySignal;

/// 参加征集活动
@property (nonatomic, strong) RACSignal *joinCollectAvtivitySignal;

/// 触发抽奖Command
@property (nonatomic, strong) RACCommand *triggerLotteryCommand;

/// 活动评论列表
@property (nonatomic, strong, readonly) NSArray<SEGActivityDetailCommentModel *> *commentsArray;

/// 活动评论总数
@property (nonatomic, copy, readonly) NSString *commentsTotalCount;

/// 提交事件
@property (nonatomic, strong) RACCommand *submitEventCommand;
/// 检查签到气泡是否展示
@property (nonatomic, strong) RACSignal *checkSignShowSignal;

/// 请求评论列表
/// @param isRefresh 是否刷新
- (RACSignal *)requestCommentList:(BOOL)isRefresh;

@end
